import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HmContractVO, HmContractForm, HmContractQuery } from '@/api/system/hmContract/types';

/**
 * 查询合同管理列表
 * @param query
 * @returns {*}
 */

export const listHmContract = (query?: HmContractQuery) => {
  return request({
    url: '/basic/hmSupplier/my/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询合同管理详细
 * @param id
 */
export const getHmContract = (id: string | number) => {
  return request({
    url: '/basic/contract/' + id,
    method: 'get'
  });
};

/**
 * 新增合同管理
 * @param data
 */
export const addHmContract = (data: any) => {
  return request({
    url: '/basic/contract',
    method: 'post',
    data: data
  });
};

/**
 * 修改合同管理
 * @param data
 */
export const updateHmContract = (data: HmContractForm) => {
  return request({
    url: '/basic/contract',
    method: 'put',
    data: data
  });
};

/**
 * 删除合同管理
 * @param id
 */
export const delHmContract = (id: string | number | Array<string | number>) => {
  return request({
    url: '/basic/hmContract/' + id,
    method: 'delete'
  });
};


/**
 * 大品牌免签修改
 * @param id
 */
export const editBigBrandStatus = (data: any) => {
  return request({
    url: '/basic/hmSupplier/editBigBrandStatus',
    method: 'post',
    data
  });
};